﻿' ----------------------------------------------------------------------------------
' Microsoft Developer & Platform Evangelism
' 
' Copyright (c) Microsoft Corporation. All rights reserved.
' 
' THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 
' OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ----------------------------------------------------------------------------------
' The example companies, organizations, products, domain names,
' e-mail addresses, logos, people, places, and events depicted
' herein are fictitious.  No association with any real company,
' organization, product, domain name, email address, logo, person,
' places, or events is intended or should be inferred.
' ----------------------------------------------------------------------------------

Imports System.Collections.ObjectModel
Imports System.Data.Services.Client
Imports System.IO
Imports System.Security
Imports Microsoft.Samples.WindowsPhoneCloud.StorageClient.Credentials

<SecuritySafeCritical()>
<CLSCompliant(False)>
Public Interface ITableServiceContext

    Event ReadingEntity As EventHandler(Of ReadingWritingEntityEventArgs)

    Event WritingEntity As EventHandler(Of ReadingWritingEntityEventArgs)

    Event SendingRequest As EventHandler(Of SendingRequestEventArgs)

    Property StorageCredentials() As IStorageCredentials

    ReadOnly Property BaseUri() As Uri

    ReadOnly Property ApplyingChanges() As Boolean

    Property DataNamespace() As String

    ReadOnly Property Entities() As ReadOnlyCollection(Of EntityDescriptor)

    Property IgnoreMissingProperties() As Boolean

    Property IgnoreResourceNotFoundException() As Boolean

    ReadOnly Property Links() As ReadOnlyCollection(Of LinkDescriptor)

    Property MergeOption() As MergeOption

    Property ResolveName() As Func(Of Type, String)

    Property ResolveType() As Func(Of String, Type)

    Property SaveChangesDefaultOptions() As SaveChangesOptions

    Property TypeScheme() As Uri

    Property UsePostTunneling() As Boolean

    Sub AddTable(ByVal table As TableServiceSchema)

    Function BeginSaveChanges(ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function BeginSaveChanges(ByVal options As SaveChangesOptions, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function EndSaveChanges(ByVal asyncResult As IAsyncResult) As DataServiceResponse

    Function BeginExecute(Of TElement)(ByVal requestUri As Uri, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function BeginExecute(Of T)(ByVal continuation As DataServiceQueryContinuation(Of T), ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function EndExecute(Of TElement)(ByVal asyncResult As IAsyncResult) As IEnumerable(Of TElement)

    Sub AddObject(ByVal entitySetName As String, ByVal entity As Object)

    Sub UpdateObject(ByVal entity As Object)

    Sub DeleteObject(ByVal entity As Object)

    Sub AddRelatedObject(ByVal source As Object, ByVal sourceProperty As String, ByVal target As Object)

    Sub AttachTo(ByVal entitySetName As String, ByVal entity As Object)

    Sub AttachTo(ByVal entitySetName As String, ByVal entity As Object, ByVal etag As String)

    Function BeginExecuteBatch(ByVal callback As AsyncCallback, ByVal state As Object, ByVal ParamArray queries() As DataServiceRequest) As IAsyncResult

    Function BeginGetReadStream(ByVal entity As Object, ByVal args As DataServiceRequestArgs, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function BeginLoadProperty(ByVal entity As Object, ByVal propertyName As String, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function BeginLoadProperty(ByVal entity As Object, ByVal propertyName As String, ByVal continuation As DataServiceQueryContinuation, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Function BeginLoadProperty(ByVal entity As Object, ByVal propertyName As String, ByVal nextLinkUri As Uri, ByVal callback As AsyncCallback, ByVal state As Object) As IAsyncResult

    Sub CancelRequest(ByVal asyncResult As IAsyncResult)

    Function Detach(ByVal entity As Object) As Boolean

    Function EndExecuteBatch(ByVal asyncResult As IAsyncResult) As DataServiceResponse

    Function EndGetReadStream(ByVal asyncResult As IAsyncResult) As DataServiceStreamResponse

    Function EndLoadProperty(ByVal asyncResult As IAsyncResult) As QueryOperationResponse

    Function GetEntityDescriptor(ByVal entity As Object) As EntityDescriptor

    Function GetMetadataUri() As Uri

    Function GetReadStreamUri(ByVal entity As Object) As Uri

    Sub SetSaveStream(ByVal entity As Object, ByVal stream As Stream, ByVal closeStream As Boolean, ByVal args As DataServiceRequestArgs)

    Sub SetSaveStream(ByVal entity As Object, ByVal stream As Stream, ByVal closeStream As Boolean, ByVal contentType As String, ByVal slug As String)

    Function TryGetEntity(Of TEntity As Class)(ByVal identity As Uri, ByRef entity As TEntity) As Boolean

    Function TryGetUri(ByVal entity As Object, ByRef identity As Uri) As Boolean

End Interface